/**
 * 本季度绩效目标
 */
import React from 'react';
import { Table } from 'antd';

export default function DetailKPI({ data = [] }) {
    const columns = [
        {
            title: '绩效目标',
            dataIndex: 'target',
            width: 400,
            editable: true
        },
        {
            title: '衡量标准/关键结果',
            dataIndex: 'performanceContent',
            editable: true
        },
        {
            title: '权重',
            dataIndex: 'weight',
            editable: true,
            width: 150,
            render(text) {
                return `${text} %`;
            }
        }
    ];

    const dataSource = React.useMemo(() => data.map((item, index) => ({ ...item, id: index })), [data]);

    return <Table rowKey="id" columns={columns} dataSource={dataSource} pagination={false} />;
}
